//
//  GetFileMode.m
//  YiLiao
//
//  Created by mac on 16/7/5.
//  Copyright © 2016年 Noah. All rights reserved.
//

#import "GetFileMode.h"
#import <AFNetworking.h>
@implementation GetFileMode
-(void)getFileMode{
    AFHTTPSessionManager *manager=[AFHTTPSessionManager manager];
    manager.responseSerializer.acceptableContentTypes=[manager.responseSerializer.acceptableContentTypes setByAddingObjectsFromSet:[NSSet setWithObjects:@"text/html", nil]];
    NSUserDefaults *user=[NSUserDefaults standardUserDefaults];
    NSString *access=[user objectForKey:@"accessToken"];
    NSDictionary *dic=@{@"command":@"ST_F_FL",@"access_token":access};
    [manager POST:@"http://localhost:8080/st/s" parameters:dic progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSLog(@"%@",responseObject);
        NSDictionary *dic=responseObject;
        [user setValue:dic forKey:@"fileKey"];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"%@",error);
    }];
}



@end
